package com.car.dal.dao.spread;


import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.JsSpread;
import com.car.util.Page;

public class JsSpreadDaoImpl extends IbatisCommonDao<JsSpread, Long> implements JsSpreadDao {

	public GridObj GetList(JsSpread spread, PageObj pageObj) {
		OrderObj order = new OrderObj();
		order.setDir("asc");
		order.setSort("id");
		return super.findByPage(spread, pageObj, order);
	}
	
	public List<JsSpread> getSpreadByUsername(JsSpread spread) {
		List<JsSpread> list=this.queryForEntityList(JsSpread.class,"getSpreadByUsername", spread);
		return list;
	}
	
	public Integer getSpCountlistByType(JsSpread spread) {
		return this.queryForInteger("getSpCountlistByType", spread);
	}
	
	public List<JsSpread> getSpreadlistByType(JsSpread spread,Page page) {
		spread.setFirstrownum(page.getFirstrownum());
		spread.setPagesize(page.getPagesize());
		List<JsSpread> list=this.queryForEntityList(JsSpread.class,"getSpreadlistByType", spread);
		return list;
	}
}
